package cn.wolfcode.luowowo.controller;



import cn.wolfcode.luowowo.domain.Banner;
import cn.wolfcode.luowowo.service.IBannerService;
import cn.wolfcode.luowowo.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("index/banners")
public class BannerController {

    @Autowired
    private IBannerService bannerService;


    /**
     * 找寻游记前五 显示在首页
     * @return
     */
    @GetMapping("/travel")
    public Object travel(){

        List<Banner> list = bannerService.queryTravelByType();

    return JsonResult.success(list) ;
    }


    /**
     * 找寻攻略第一的 显示在首页
     * @return
     */
    @GetMapping("/strategy")
    public Object strategy(){

        List<Banner> list = bannerService.queryStrategyByType();

        return JsonResult.success(list.get(0)) ;
    }




}
